﻿<?xml version="1.0" encoding="utf-8" ?>
<Form Name="My Form" ValidationSummary="true" SuccessPage="/Pages/Success.aspx" UseDefaultStyle="true" EmailEnabled="false">
    <Providers>
        <Provider Type="DataStore" Name="StandardProvider" />
        <Provider Type="FileSystem" Name="StandardProvider" />
        <Provider Type="Validation" Name="StandardProvider" />
        <Provider Type="Email" Name="StandardProvider" RecipientAddress="formsy_recipient@yourdomain.com" SenderAddress="no-reply@yourdomain.com" />
    </Providers>

    <FieldSet Name="Sign Up">

        <Field Name="First Name" Type="TextBox">
            <Validator Type="RequiredFieldValidator" Text="*" ErrorMessage="Please enter a first name" Display="Dynamic"/>
            <Validator Type="RegularExpressionValidator" Text="*" ErrorMessage="Please enter letters only" ValidationExpression=".*" Display="Dynamic"/>
        </Field>

        <Field Name="Last Name" Type="TextBox">
            <Validator Type="RequiredFieldValidator" Text="*" ErrorMessage="Please enter a last name" />
            <Validator Type="RegularExpressionValidator" Text="*" ErrorMessage="Please enter letters only" ValidationExpression=".*" Display="Dynamic"/>
        </Field>

        <Field Name="Email" Type="EmailPair" Label="EmailLabel">
            <Validator Type="CompareValidator" Text="*" ErrorMessage="Emails must definitely match" Display="Dynamic"/>
            <Validator Type="RequiredFieldValidator" Text="*" ErrorMessage="Please enter your email address" Display="Dynamic"/>
        </Field>

        <Field Name="Street Number" Type="TextBox">
            <Validator Type="RequiredFieldValidator" Text="*" ErrorMessage="Please enter a street number" />
        </Field>

        <Field Name="Street Name" Type="TextBox">
            <Validator Type="RequiredFieldValidator" Text="*" ErrorMessage="Please enter a street name" />
        </Field>

        <Field Name="Street Type" Type="DropDownList">
            <Provider Type="DataSource" Name="XmlProvider">
                <Parameter>/Xml/Streets.xml</Parameter>
                <Parameter>StreetTypes</Parameter>
                <Parameter>StreetType</Parameter>
            </Provider>
            <!--<Items>
                <Item Text="Please select" Value="" />
                <Item Text="Avenue" Value="Avenue" />
                <Item Text="Road" Value="Road" />
                <Item Text="Street" Value="Street" />
            </Items>-->
            <Validator Type="RequiredFieldValidator" Text="*" ErrorMessage="Please select a street type" Display="Dynamic"/>
        </Field>

        <Field Name="Suburb" Type="TextBox">
            <Validator Type="RequiredFieldValidator" Text="*" ErrorMessage="Please enter a street suburb" />
        </Field>

        <Field Name="State" Type="DropDownList">
            <Items>
                <Item Text="Please select" Value="" />
                <Item Text="ACT" Value="ACT" />
                <Item Text="QLD" Value="QLD" />
                <Item Text="NSW" Value="NSW" />
                <Item Text="NT" Value="NT" />
                <Item Text="TAS" Value="TAS" />
                <Item Text="VIC" Value="VIC" />
                <Item Text="WA" Value="WA" />
            </Items>
            <Validator Type="RequiredFieldValidator" Text="*" ErrorMessage="Please select a state" Display="Dynamic"/>
        </Field>

        <Field Name="Postcode" Type="TextBox">
            <Validator Type="RequiredFieldValidator" Text="*" ErrorMessage="Please enter a postcode" />
        </Field>


        <Field Name="PasswordPair" Type="PasswordPair" Label="Password">
            <Validator Type="CompareValidator" Text="*" ErrorMessage="Passwords must definitely match" Display="Dynamic"/>
            <Validator Type="RequiredFieldValidator" Text="*" ErrorMessage="Please enter a password pair" Display="Dynamic"/>
        </Field>

    </FieldSet>


    <FieldSet>
        <Field Name="Terms and Conditions" Type="CheckBox" Label="Do you agree to the &lt;a href='http://google.com'&gt; terms and conditions&lt;/a&gt;?" IgnoreData="true">
            <Validator Type="RequiredFieldValidator" Text="*" ErrorMessage="Please agree to the terms and conditions" Display="Dynamic"/>
        </Field>

        <Field Name="Footer message" Type="Literal" Text="This is a random message in a Literal with a &lt;a href='http://www.google.com.au'&gt;link&lt;/a&gt;">
        </Field>

        <Field Name="Hidden Field 1" Type="HiddenField" Value="Test" IgnoreData="true" >
        </Field>
    </FieldSet>
</Form>